package com.lagou.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Roger
 * @date 2020/8/20 15:47
 * @description
 */
//@Controller
    @RestController
public class RestfulController {

        /*
            @GetMapping("/user/{id}") 就等价于@RequestMapping(value = "/user/{id}", method = RequestMethod.GET)
            @RestController等于 @controller + @responseBody
         */
//    @RequestMapping(value = "/user/{id}", method = RequestMethod.GET)
//    @ResponseBody
    @GetMapping("/user/{id}")
    public String get(@PathVariable Integer id){
        System.out.println(id);
        return "get:" + id;
    }

}
